Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes junit 4 dependency #3627

Merged
merged 4 commits into from
Dec 12, 2023
Merged

Removes junit 4 dependency #3627

merged 4 commits into from
Dec 12, 2023

Conversation

codefromthecrypt
Copy link
Member

@codefromthecrypt codefromthecrypt commented Dec 12, 2023

This changes to the next minor so that we can remove the junit 4 compile dependency. To do so, this ports all tests to jupiter (v5) and stops publishing zipkin-junit (v4).

The plan is to cut a new version without any changes to the main tree. This will allow a cleaner cutover for server extensions who can first move to the latest patch, and subsequently the next minor. Specifically, this is for zipkin-gcp and zipkin-aws and I personally will handle this.

Note: Certain test libraries, notably testcontainers and activemq-junit have an indirect dependency on old junit. However, we don't re-export that in our zipkin-tests or zipkin-junit5 modules.

While I had to do some manual work, I had a lot of help from openrewrite. Here's the part that helped a lot.

$ ./mvnw -U org.openrewrite.maven:rewrite-maven-plugin:run \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-testing-frameworks:LATEST \
  -Drewrite.activeRecipes=org.openrewrite.java.testing.junit5.JUnit4to5Migration

Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt codefromthecrypt marked this pull request as ready for review December 12, 2023 12:31
@codefromthecrypt
Copy link
Member Author

manually verified also, since there are a lot of lines.

$ ag 'import .*junit.' --java --noheading |grep -v '^\s*$' | wc -l
     352
$ ag 'import .*junit.' --java --noheading |egrep -v '(^\s*$|junit5|jupiter)'
zipkin-collector/activemq/src/test/java/zipkin2/collector/activemq/ITActiveMQCollector.java:27:import org.apache.activemq.junit.EmbeddedActiveMQBroker;

Adrian Cole added 2 commits December 12, 2023 20:03
Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@@ -187,37 +185,14 @@
<!-- Do not add compile dependencies here. This can cause problems for libraries that depend on
io.zipkin.zipkin2:zipkin difficult to unravel. -->

<dependency>
<groupId>junit</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed through a few files for kicks but this is probably the main change and if build is green then it looks like it worked well

@timtebeek
Copy link
Contributor

Might be worth to followup with these AssertJ best practices once this is merged, or cherry pick that into here:
master...timtebeek:zipkin:refactor/assertj-best-practices

@codefromthecrypt
Copy link
Member Author

Thanks @timtebeek I'll create a PR off your changes next.

@codefromthecrypt codefromthecrypt merged commit 25dfdbd into master Dec 12, 2023
10 checks passed
@codefromthecrypt codefromthecrypt deleted the jupiter branch December 12, 2023 22:43
@timtebeek
Copy link
Contributor

I'm seeing there's conflicts; would you want me to recreate the changes? That's trivial with the platform we have.

@codefromthecrypt
Copy link
Member Author

added #3630 and will cut the minor afterwards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants